{{include file="header.tpl"}}

<!--content-->
<div class="w1002 Invsest_top">
<div class="Invsest_top_all">
    <div class="Fl Invsest_top_Left">
        <table width="95%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              
                <td width="15%" height="32"><span class="Invsest_check">多选</span></td>
                <td width="10%">&nbsp;</td>
                <td width="12%">&nbsp;</td>
                <td width="14%">&nbsp;</td>
                <td width="17%">&nbsp;</td>
                <td width="18%">&nbsp;</td>
                <td width="14%">&nbsp;</td>
            </tr>
            <tr>
                <td height="22">借款期限：</td>
                <td><a href="index.php?ctl=deal&time=0&price={{$smarty.get.price}}&rate={{$smarty.get.rate}}" {{if $smarty.get.time==0}}class="active"{{/if}}>全部</a></td>
                <td><a href="index.php?ctl=deal&time=1&price={{$smarty.get.price}}&rate={{$smarty.get.rate}}" {{if $smarty.get.time==1}}class="active"{{/if}}>3-6个月 </a></td>
                <td><a href="index.php?ctl=deal&time=2&price={{$smarty.get.price}}&rate={{$smarty.get.rate}}" {{if $smarty.get.time==2}}class="active"{{/if}}>9-15个月 </a></td>
                <td><a href="index.php?ctl=deal&time=3&price={{$smarty.get.price}}&rate={{$smarty.get.rate}}" {{if $smarty.get.time==3}}class="active"{{/if}}>18-24个月 </a></td>
                <td><a href="index.php?ctl=deal&time=4&price={{$smarty.get.price}}&rate={{$smarty.get.rate}}" {{if $smarty.get.time==4}}class="active"{{/if}}>24个月以上</a></td>
                <td>&nbsp;</td>
            </tr>
            <tr>
                <td height="22">项目金额：</td>
                <td><a href="index.php?ctl=deal&time={{$smarty.get.time}}&price=0&rate={{$smarty.get.rate}}" {{if $smarty.get.price==0}}class="active"{{/if}}>全部</a></td>
                <td><a href="index.php?ctl=deal&time={{$smarty.get.time}}&price=1&rate={{$smarty.get.rate}}" {{if $smarty.get.price==1}}class="active"{{/if}}>0-5万元</a></td>
                <td><a href="index.php?ctl=deal&time={{$smarty.get.time}}&price=2&rate={{$smarty.get.rate}}" {{if $smarty.get.price==2}}class="active"{{/if}}>5-10万元</a> </td>
                <td><a href="index.php?ctl=deal&time={{$smarty.get.time}}&price=3&rate={{$smarty.get.rate}}" {{if $smarty.get.price==3}}class="active"{{/if}}>15-20万元</a> </td>
                <td><a href="index.php?ctl=deal&time={{$smarty.get.time}}&price=4&rate={{$smarty.get.rate}}" {{if $smarty.get.price==4}}class="active"{{/if}}>20-50万元</a></td>
                <td>&nbsp;</td>
            </tr>
            <tr>
                <td height="22">年化收益率：</td>
                <td><a href="index.php?ctl=deal&time={{$smarty.get.time}}&price={{$smarty.get.price}}&rate=0" {{if $smarty.get.rate==0}}class="active"{{/if}}>全部</a></td>
                <td><a href="index.php?ctl=deal&time={{$smarty.get.time}}&price={{$smarty.get.price}}&rate=1" {{if $smarty.get.rate==1}}class="active"{{/if}}>0-8%</a></td>
                <td><a href="index.php?ctl=deal&time={{$smarty.get.time}}&price={{$smarty.get.price}}&rate=2" {{if $smarty.get.rate==2}}class="active"{{/if}}>10-15%</a></td>
                <td><a href="index.php?ctl=deal&time={{$smarty.get.time}}&price={{$smarty.get.price}}&rate=3" {{if $smarty.get.rate==3}}class="active"{{/if}}>20-25%</a></td>
                <td><a href="index.php?ctl=deal&time={{$smarty.get.time}}&price={{$smarty.get.price}}&rate=4" {{if $smarty.get.rate==4}}class="active"{{/if}}>15-17%</a></td>
                <td><a href="index.php?ctl=deal&time={{$smarty.get.time}}&price={{$smarty.get.price}}&rate=5" {{if $smarty.get.rate==5}}class="active"{{/if}}>19-20%</a></td>
            </tr>
        </table>

    </div>
    <div class="Fr Invsest_top_Right">
        <ul>
            {{foreach from=$newlist.data item=item}}
            <li>·<a href="index.php?ctl=article&act=show&id={{$item.ID}}">{{$item.TITLE}}</a></li>
            {{/foreach}}
        </ul>
    
    </div>
    <br class="Spacer1" />
</div>
</div>
<div class="w1002 Mar14 Invsest_mid">
<span>温馨提示：近期工作日固定发标时间在11：00、13：30、17：00，其余时间与周末随机发标</span>
</div>
<div class="w1002 Mar14 Invsest_bottom">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
       <tr>
        <th width="14%" height="40">项目名称 </th>
        <th width="18%">项目编号 </th>
        <th width="13%">项目金额 </th>
        <th width="12%">年化收益率 </th>
        <th width="10%"> 投资期限 </th>
        <th width="17%">剩余时间 </th>
        <th width="5%">进度</th>
        <th width="11%">状态/操作</th>
      </tr>
{{foreach from=$res.data item=item key=key}}
      <tr>
      <td><a href="index.php?ctl=deal&act=bid&id={{$item.ID}}">{{$item.TITLE}}</a></td>
        <td>{{$item.CODE}}</td>
        <td>{{$item.PRICE}}元 </td>
        <td>14%</td>
        <td> {{$item.REPAY_TIME}}个月</td>
        <td>           
            {{if $item.loading == 100 || $item.stime < 0 || $item.deal_stat ==3 || $item.deal_stat ==4}}
            投标结束
            {{else}}
            <p id="time_{{$key}}"></p><div style="DISPLAY: none" id="sec_left_{{$key}}" class="time_left">{{$item.stime}}{{$key}}</div>
            {{/if}}
        </td>
        <td><div class="progressbar progressbar-{{$item.loading}}"><span>{{$item.loading}}</span>%</div></td>
        <td>{{if $item.loading == 100 || $item.stime < 0 || $item.deal_stat ==3 || $item.deal_stat ==4}}
             <span class="index_invest_btn">投标结束</span>
            {{else}}
             <a href="index.php?ctl=deal&act=bid&id={{$item.ID}}"><span class="index_invest_btn">投资</span></a>
            {{/if}}
        </td>
      </tr>
    {{/foreach}}
    </table>
    <div class="page_center">{{$res.page}}</div>
</div>

<link rel="stylesheet" type="text/css" href="res/css/progressbar.css">
<script type="text/javascript">
$(function() {
    $('.progressbar').each(function(index, el) {
        var num = $(this).find('span').text();
        $(this).addClass('progressbar-' + num);
    });
});
</script>
<script type="text/javascript">
      var second =null; 
      var minite = null; 
      var hour = null; 
      var day = null; 
      var seconds = null;
      var sec = {};
      function getInitTime(){
          $('.time_left').each(function(){
             var jobj = $(this);
             var SysSecond = parseInt(jobj.text());
             var theid = parseInt((jobj.attr('id')).replace(/sec_left_/,''));
             sec[theid]= SysSecond;
          });
      }
      getInitTime();
      function SetRemainTime() {
            for(var i in sec){
                setRemainTimeSite(i,sec[i]);
            }
       }
      function setRemainTimeSite(theid,SysSs){
          seconds = SysSs/10;
          second = Math.floor(seconds % 60).toString();
          minite = Math.floor((seconds / 60) % 60).toString();
          hour = Math.floor((seconds / 3600) % 24).toString();
          day = Math.floor((seconds / 3600) / 24).toString();
          if (SysSs >= 0) {
               var ss = Math.floor(SysSs % 10).toString();
               if(SysSs % 10==0){
                  seconds = SysSs/10;
                  second = Math.floor(seconds % 60).toString();
                  minite = Math.floor((seconds / 60) % 60).toString();
                  hour = Math.floor((seconds / 3600) % 24).toString();
                  day = Math.floor((seconds / 3600) / 24).toString();
               }
               $("#time_"+theid).html(day + "天" + hour + "小时" + minite + "分" + second + "秒."+ss);
               sec[theid]--;
               SysSs--;
          }else{
            return;
          }
        }
      window.setInterval(SetRemainTime,100);
</script>

{{include file="footer.tpl"}}